﻿using System.ComponentModel;
using CommonLibrary.Helpers;
using FileLibrary.Enums;

namespace FileLibrary.Models
{
    [Description("开行计划")]
    public class TrainPlan : FileModel
    {
        private string trainGroupTypeStr;
        private TrainGroupTypeEnum trainGroupTypeEnum;

        [Description("车组号")]
        public string TrainId { get; set; }
        [Description("入所车次")]
        public string TrainOrderInDepot { get; set; }
        [Description("入所时间")]
        public string TimeInDepot { get; set; }
        [Description("入所口")]
        public string TrackNameInDepot { get; set; }
        [Description("接车股道")]
        public string ArriveNameTrack { get; set; }
        [Description("出所车次")]
        public string TrainOrderOutDepot { get; set; }
        [Description("出所时间")]
        public string TimeOutDepot { get; set; }
        [Description("出所口")]
        public string TrackNameOutDepot { get; set; }
        [Description("发车股道")]
        public string DepartNameTrack { get; set; }
        [Description("编组类型")]
        public string TrainGroupTypeStr
        {
            get { return trainGroupTypeStr; }
            set
            {
                trainGroupTypeStr = value;
                trainGroupTypeEnum = trainGroupTypeStr.Parse<TrainGroupTypeEnum>();
            }
        }

        public TrainGroupTypeEnum TrainGroupTypeEnum => trainGroupTypeEnum;
    }
}
